package com.avic.rong.goodsSort.activity.secondListActivity;

import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.constraint.ConstraintLayout;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.avic.rong.BaseActivity;
import com.avic.rong.R;
import com.avic.rong.goodsSort.CarView;
import com.avic.rong.goodsSort.activity.GoodsSortActivity;
import com.avic.rong.goodsSort.activity.MaxRecyclerView;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortGjDrawerPlatformCarrierAdapter;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortGjDrawerPriceMianYiAdapter;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortGjDrawerRJCPAdapter;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortGjDrawerUsageModeAdapter;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortGjDrawerUseTimeAdapter;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortGjDrawerVersionInformationAdapter;
import com.avic.rong.goodsSort.adapter.drawerAdapter.GoodsSortWdDrawerRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortBzDrawerDownTimeRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortBzDrawerStateRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortBzDrawerUpTimeRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortBzShowRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortBzShowSxRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortBzShowTimeRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortGjShowRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortGjShowSxRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortTsDrawerChuBanSheRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortTsDrawerDateRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortTsDrawerFenLeiRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortTsShowRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortTsSxShowRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortTsTimeShowRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortWdShowRvAdapter;
import com.avic.rong.goodsSort.adapter.secondListAdapter.GoodsSortWdShowRvSxAdapter;
import com.avic.rong.goodsSort.api.drawerApi.GoodsSortGjDrawerApi;
import com.avic.rong.goodsSort.api.drawerApi.GoodsSortWdDrawerApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllBzApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllBzSXApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllGjApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllGjSxApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllTsApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllTsSxApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllWdApi;
import com.avic.rong.goodsSort.api.secondListApi.GoodsSortSearchAllWdSxApi;
import com.avic.rong.goodsSort.bean.GoodsSortDrawerBean;
import com.avic.rong.goodsSort.bean.secondDrawerBean.GoodsSortGjDrawerBean;
import com.avic.rong.goodsSort.bean.secondDrawerBean.GoodsSortGjDrawerOtherBean;
import com.avic.rong.goodsSort.bean.secondDrawerBean.GoodsSortWdDrwerBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllBzBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllBzSxBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllBzTimeBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllGjBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllTsBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllTsTimeBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchAllWdBean;
import com.avic.rong.goodsSort.bean.showRvBean.GoodsSortSearchTsSxBean;
import com.avic.rong.search.api.SearchTsAttributeApi;
import com.avic.rong.search.bean.SearchTsAttributeBean;
import com.avic.rong.shoppingCar.activity.ShoppingCarActivity;
import com.avic.rong.shoppingCar.api.ShoppingCarListApi;
import com.avic.rong.shoppingCar.bean.ShoppingCarListBean;
import com.avic.rong.userOrder.api.AddCarApi;
import com.avic.rong.utils.ConstantsUtils;
import com.avic.rong.utils.DateUtils;
import com.avic.rong.utils.DeviceUtils;
import com.avic.rong.utils.EditUtils;
import com.avic.rong.utils.SharedPreferencesUtil;
import com.avic.rong.utils.ToastTools;
import com.avic.rong.wedgit.loadingLayout.LoadingLayout;
import com.example.minato.minastore.BaseResultEntity;
import com.example.minato.minastore.http.HttpManager;
import com.example.minato.minastore.listener.HttpOnNextListener;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;

import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import butterknife.BindView;
import butterknife.ButterKnife;

public class GoodsSortAllActivity extends BaseActivity implements View.OnClickListener,
        GoodsSortBzDrawerUpTimeRvAdapter.GoodsSortBzDrawerUpTimeListener,
        GoodsSortBzDrawerStateRvAdapter.GoodsSortBzDrawerStateListener,
        GoodsSortBzDrawerDownTimeRvAdapter.GoodsSortBzDrawerDownTimeListener,
        GoodsSortBzShowRvAdapter.GoodsBzRvListener,
        GoodsSortBzShowTimeRvAdapter.GoodsBzTimeRvListener,
        GoodsSortTsDrawerChuBanSheRvAdapter.GoodsSortTsDrawerChuBanSheListener,
        GoodsSortTsDrawerDateRvAdapter.GoodsSortTsDrawerDateListener,
        GoodsSortTsDrawerFenLeiRvAdapter.GoodsSortTsDrawerFenLeiListener,
        GoodsSortTsShowRvAdapter.GoodsTsRvListener,
        GoodsSortTsTimeShowRvAdapter.GoodsTsTimeRvListener,
        GoodsSortWdDrawerRvAdapter.GoodsSortWdDrawerListener,
        GoodsSortWdShowRvAdapter.GoodsWdListener,
        GoodsSortGjDrawerRJCPAdapter.GoodsSortGjDrawerRJCPListener,
        GoodsSortGjDrawerUsageModeAdapter.GoodsSortGjDrawerUsageModeListener
        , GoodsSortGjDrawerVersionInformationAdapter.GoodsSortGjDrawerVersionInformationListener,
        GoodsSortGjDrawerUseTimeAdapter.GoodsSortGjDrawerUseTimeListener,
        GoodsSortGjDrawerPriceMianYiAdapter.GoodsSortGjDrawerPriceMianYiListener
        , GoodsSortGjDrawerPlatformCarrierAdapter.GoodsSortGjDrawerPlatformCarrierListener,
        GoodsSortGjShowRvAdapter.GoodsGjListener,
        GoodsSortBzShowSxRvAdapter.GoodsBzSxRvListener,
        GoodsSortTsSxShowRvAdapter.GoodsTsSxRvListener
        , GoodsSortWdShowRvSxAdapter.GoodsWdSxListener,
        GoodsSortGjShowSxRvAdapter.GoodsGjSxListener {

    @BindView(R.id.goods_sort_all_back)
    ImageView goodsSortAllBack;
    @BindView(R.id.goods_sort_all_fenlei)
    ImageView goodsSortAllFenlei;
    @BindView(R.id.goods_sort_all_edit)
    EditText goodsSortAllEdit;
    @BindView(R.id.goods_sort_all_title)
    RelativeLayout goodsSortAllTitle;
    @BindView(R.id.goods_sort_all_zh)
    RadioButton goodsSortAllZh;
    @BindView(R.id.goods_sort_all_time)
    RadioButton goodsSortAllTime;
    @BindView(R.id.goods_sort_all_hot)
    RadioButton goodsSortAllHot;
    @BindView(R.id.goods_sort_all_shaixuan)
    RadioButton goodsSortAllShaixuan;
    @BindView(R.id.goods_sort_all_bz)
    TextView goodsSortAllBz;
    @BindView(R.id.goods_sort_all_ts)
    TextView goodsSortAllTs;
    @BindView(R.id.goods_sort_all_wd)
    TextView goodsSortAllWd;
    @BindView(R.id.goods_sort_all_gj)
    TextView goodsSortAllGj;
    @BindView(R.id.goods_sort_all_sort)
    LinearLayout goodsSortAllSort;
    @BindView(R.id.goods_sort_all_fenge)
    View goodsSortAllFenge;
    @BindView(R.id.goods_sort_all_Rv)
    MaxRecyclerView goodsSortAllRv;
    @BindView(R.id.goods_sort_bz_drawer_zhankai)
    TextView goodsSortBzDrawerZhankai;
    @BindView(R.id.goods_sort_bz_drawer_topRv)
    RecyclerView goodsSortBzDrawerTopRv;
    @BindView(R.id.goods_sort_bz_drawer_fabu_start)
    TextView goodsSortBzDrawerFabuStart;
    @BindView(R.id.goods_sort_bz_drawer_fabu_end)
    TextView goodsSortBzDrawerFabuEnd;
    @BindView(R.id.goods_sort_bz_drawer_fabuRv)
    RecyclerView goodsSortBzDrawerFabuRv;
    @BindView(R.id.goods_sort_bz_drawer_shishi_start)
    TextView goodsSortBzDrawerShishiStart;
    @BindView(R.id.goods_sort_bz_drawer_shishi_end)
    TextView goodsSortBzDrawerShishiEnd;
    @BindView(R.id.goods_sort_bz_drawer_shishiRv)
    RecyclerView goodsSortBzDrawerShishiRv;
    @BindView(R.id.goods_sort_bz_drawer_qicaoEdit)
    EditText goodsSortBzDrawerQicaoEdit;
    @BindView(R.id.goods_sort_bz_drawer_danweiEdit)
    EditText goodsSortBzDrawerDanweiEdit;
    @BindView(R.id.goods_sort_bz_drawer_Reset)
    TextView goodsSortBzDrawerReset;
    @BindView(R.id.goods_sort_bz_drawer_Sure)
    TextView goodsSortBzDrawerSure;
    @BindView(R.id.goods_sort_bz_drawer)
    ConstraintLayout goodsSortBzDrawer;
    @BindView(R.id.shop_drawer_bz)
    LinearLayout shopDrawerBz;
    @BindView(R.id.goods_sort_ts_drawer_fenlei_tv)
    TextView goodsSortTsDrawerFenleiTv;
    @BindView(R.id.goods_sort_ts_drawer_fenlei_rv)
    RecyclerView goodsSortTsDrawerFenleiRv;
    @BindView(R.id.goods_sort_ts_drawer_chubanshe_tv)
    TextView goodsSortTsDrawerChubansheTv;
    @BindView(R.id.goods_sort_ts_drawer_chubanshe_rv)
    RecyclerView goodsSortTsDrawerChubansheRv;
    @BindView(R.id.goods_sort_ts_drawer_author_edit)
    EditText goodsSortTsDrawerAuthorEdit;
    @BindView(R.id.goods_sort_ts_drawer_chubantime_start)
    TextView goodsSortTsDrawerChubantimeStart;
    @BindView(R.id.goods_sort_ts_drawer_chubantime_end)
    TextView goodsSortTsDrawerChubantimeEnd;
    @BindView(R.id.goods_sort_ts_drawer_chubantime_rv)
    RecyclerView goodsSortTsDrawerChubantimeRv;
    @BindView(R.id.goods_sort_ts_drawer_Reset)
    TextView goodsSortTsDrawerReset;
    @BindView(R.id.goods_sort_ts_drawer_Sure)
    TextView goodsSortTsDrawerSure;
    @BindView(R.id.goods_sort_ts_drawer)
    ConstraintLayout goodsSortTsDrawer;
    @BindView(R.id.shop_drawer_ts)
    LinearLayout shopDrawerTs;
    @BindView(R.id.goods_sort_wd_relativeLayout)
    RelativeLayout goodsSortWdRelativeLayout;
    @BindView(R.id.goods_sort_wd_drawer_fenlei_rv)
    RecyclerView goodsSortWdDrawerFenleiRv;
    @BindView(R.id.goods_sort_wd_drawer_Reset)
    TextView goodsSortWdDrawerReset;
    @BindView(R.id.goods_sort_wd_drawer_Sure)
    TextView goodsSortWdDrawerSure;
    @BindView(R.id.shop_drawer_wd)
    LinearLayout shopDrawerWd;
    @BindView(R.id.goods_sort_gj_drawer_ruanjianchanpin_rv)
    RecyclerView goodsSortGjDrawerRuanjianchanpinRv;
    @BindView(R.id.goods_sort_gj_drawer_shiyongfangshi_rv)
    RecyclerView goodsSortGjDrawerShiyongfangshiRv;
    @BindView(R.id.goods_sort_gj_drawer_banbenxinxi_rv)
    RecyclerView goodsSortGjDrawerBanbenxinxiRv;
    @BindView(R.id.goods_sort_gj_drawer_shiyongshixiao_rv)
    RecyclerView goodsSortGjDrawerShiyongshixiaoRv;
    @BindView(R.id.goods_sort_gj_drawer_pingtaizaiti_rv)
    RecyclerView goodsSortGjDrawerPingtaizaitiRv;
    @BindView(R.id.goods_sort_gj_drawer_jiagemianyi_rv)
    RecyclerView goodsSortGjDrawerJiagemianyiRv;
    @BindView(R.id.goods_sort_gj_drawer_Reset)
    TextView goodsSortGjDrawerReset;
    @BindView(R.id.goods_sort_gj_drawer_Sure)
    TextView goodsSortGjDrawerSure;
    @BindView(R.id.goods_sort_gj_drawer)
    ConstraintLayout goodsSortGjDrawer;
    @BindView(R.id.shop_drawer_gj)
    LinearLayout shopDrawerGj;
    @BindView(R.id.goods_sort_all_DrawerLayout)
    DrawerLayout goodsSortAllDrawerLayout;
    @BindView(R.id.search_all_SmartRefreshLayout)
    SmartRefreshLayout searchAllSmartRefreshLayout;
    @BindView(R.id.goods_sort_bz_drawer_zhubianEdit)
    EditText goodsSortBzDrawerZhubianEdit;
    @BindView(R.id.goods_sort_bz_drawer_zhubanEdit)
    EditText goodsSortBzDrawerZhubanEdit;
    @BindView(R.id.goods_sort_all_LoadingLayout)
    LoadingLayout goodsSortAllLoadingLayout;
    private String keyword;
    private CarView carView;
    private TextView carTv;
    private int pageNo = 1;
    private int currentState = 1;
    //标准
    private boolean bzTimeFlag = false;
    private GoodsSortBzDrawerUpTimeRvAdapter bzDrawerUptimeAdapter;
    private GoodsSortBzDrawerDownTimeRvAdapter bzDrawerDowntimeAdapter;
    private GoodsSortBzDrawerStateRvAdapter bzDrawerStateAdapter;
    private GoodsSortBzShowRvAdapter bzShowRvAdapter;
    private GoodsSortBzShowTimeRvAdapter bzShowTimeRvAdapter;
    private GoodsSortBzShowSxRvAdapter showBzSxRvAdapter;
    private List<GoodsSortDrawerBean> bzTimeList = new ArrayList<>();
    private List<GoodsSortDrawerBean> bzTimeList1 = new ArrayList<>();
    private List<GoodsSortDrawerBean> bzStateList = new ArrayList<>();
    private List<GoodsSortSearchAllBzBean.DataBean> bzBeanList = new ArrayList<>();
    private List<GoodsSortSearchAllBzTimeBean.DataBean> bzTimeBeanList = new ArrayList<>();
    private List<GoodsSortSearchAllBzSxBean.DataBean> bzShaiXuanBeanList = new ArrayList<>();
    //图书
    private List<GoodsSortSearchAllTsBean.DataBean> tsBeanList = new ArrayList<>();
    private List<GoodsSortSearchAllTsTimeBean.DataBean> tsTimeBeanList = new ArrayList<>();
    private List<GoodsSortSearchTsSxBean.DataBean> tsSxList = new ArrayList<>();
    private GoodsSortTsShowRvAdapter tsShowRvAdapter;
    private GoodsSortTsTimeShowRvAdapter tsShowTimeRvAdapter;
    private GoodsSortTsSxShowRvAdapter tsShowTsSxRvAdapter;
    private boolean tsTimeFlag = false;
    private GoodsSortTsDrawerFenLeiRvAdapter tsDrawerFenLeiRvAdapter;
    private GoodsSortTsDrawerChuBanSheRvAdapter tsDrawerChuBanSheRvAdapter;
    private GoodsSortTsDrawerDateRvAdapter tsDrawerDateRvAdapter;
    private List<SearchTsAttributeBean.BookCatBean> tsTsFenLeiDrawerList = new ArrayList<>();
    private ArrayList<GoodsSortDrawerBean> tsTimeDrawerList = new ArrayList<>();
    private ArrayList<GoodsSortDrawerBean> tsChuBanSheDrawerList = new ArrayList();

    //文档
    private GoodsSortWdShowRvAdapter wdShowRvAdapter;
    private GoodsSortWdShowRvSxAdapter wdShowRvSxAdapter;
    private GoodsSortWdDrawerRvAdapter wdDrawerRvAdapter;
    private List<GoodsSortSearchAllWdBean.DataBean> wdBeanList = new ArrayList<>();
    private List<GoodsSortSearchAllWdBean.DataBean> wdSxBeanList = new ArrayList<>();
    private ArrayList<GoodsSortWdDrwerBean> wdDrwerList = new ArrayList<>();
    private boolean wdTimeFlag = false;

    //软件工具
    private List<GoodsSortSearchAllGjBean.DataBean> gjBeanList = new ArrayList<>();
    private GoodsSortGjShowRvAdapter showRvAdapter;
    private GoodsSortGjShowSxRvAdapter showSxRvAdapter;
    private List<GoodsSortSearchAllGjBean.DataBean> gjSxBeanList = new ArrayList<>();
    //使用方式
    private List<GoodsSortGjDrawerOtherBean> usageModeList = new ArrayList<>();
    //版本信息
    private List<GoodsSortGjDrawerOtherBean> versionInformationList = new ArrayList<>();
    //使用时效
    private List<GoodsSortGjDrawerOtherBean> useTimeList = new ArrayList<>();
    //价格面议
    private List<GoodsSortGjDrawerOtherBean> priceNegotiableList = new ArrayList<>();
    //平台载体
    private List<GoodsSortGjDrawerOtherBean> platformCarrierList = new ArrayList<>();
    //软件产品
    private List<GoodsSortGjDrawerBean.CategoryBean.SubCategoryBean> subCategoryBeanList = new ArrayList<>();

    private GoodsSortGjDrawerRJCPAdapter rjcpAdapter;
    private GoodsSortGjDrawerUsageModeAdapter usageModeAdapter;
    private GoodsSortGjDrawerUseTimeAdapter useTimeAdapter;
    private GoodsSortGjDrawerPriceMianYiAdapter priceMianYiAdapter;
    private GoodsSortGjDrawerVersionInformationAdapter versionInformationAdapter;
    private GoodsSortGjDrawerPlatformCarrierAdapter platformCarrierAdapter;
    private boolean timeFlag = false;
    private GoodsSortSearchAllBzApi searchAllApi;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_goods_sort_all);
        ButterKnife.bind(this);
        goodsSortAllRv.setNestedScrollingEnabled(false);
        goodsSortAllDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
        goodsSortAllZh.setSelected(true);
        goodsSortAllBz.setSelected(true);
        Intent intent = getIntent();
        keyword = intent.getStringExtra("keyword");
        goodsSortAllEdit.setText(keyword);
        carView = new CarView(this);
        carTv = carView.findViewById(R.id.car_number);
        carView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(GoodsSortAllActivity.this, ShoppingCarActivity.class);
                startActivity(intent);

            }
        });

        initOtherAdapter();
        //加载购物车商品数量
        loadCarData();
        //初始加载标准数据
        initBzRvData(keyword);

        carView.show();

        initListener();

        goodsSortAllLoadingLayout.setOnReloadListener(new LoadingLayout.OnReloadListener() {
            @Override
            public void onReload(View v) {
                HttpManager.getInstance().doHttpDeal(searchAllApi);
                goodsSortAllLoadingLayout.setStatus(LoadingLayout.LOADING);
            }

            @Override
            public void onReturn(View v) {
                onBackPressed();
            }
        });
        goodsSortAllLoadingLayout.setStatus(LoadingLayout.LOADING);

    }

    private void initListener() {
        goodsSortAllBack.setOnClickListener(this);
        goodsSortAllFenlei.setOnClickListener(this);

        goodsSortAllZh.setOnClickListener(this);
        goodsSortAllTime.setOnClickListener(this);
        goodsSortAllHot.setOnClickListener(this);
        goodsSortAllShaixuan.setOnClickListener(this);

        goodsSortAllBz.setOnClickListener(this);
        goodsSortAllTs.setOnClickListener(this);
        goodsSortAllWd.setOnClickListener(this);
        goodsSortAllGj.setOnClickListener(this);

        //标准
        goodsSortBzDrawerFabuStart.setOnClickListener(this);
        goodsSortBzDrawerFabuEnd.setOnClickListener(this);
        goodsSortBzDrawerShishiStart.setOnClickListener(this);
        goodsSortBzDrawerShishiEnd.setOnClickListener(this);

        goodsSortBzDrawerReset.setOnClickListener(this);
        goodsSortBzDrawerSure.setOnClickListener(this);

        //图书
        goodsSortTsDrawerFenleiTv.setOnClickListener(this);
        goodsSortTsDrawerChubansheTv.setOnClickListener(this);
        goodsSortTsDrawerChubantimeStart.setOnClickListener(this);
        goodsSortTsDrawerChubantimeEnd.setOnClickListener(this);

        goodsSortTsDrawerReset.setOnClickListener(this);
        goodsSortTsDrawerSure.setOnClickListener(this);

        //文档
        goodsSortWdDrawerReset.setOnClickListener(this);
        goodsSortWdDrawerSure.setOnClickListener(this);

        //软件工具
        goodsSortGjDrawerReset.setOnClickListener(this);
        goodsSortGjDrawerSure.setOnClickListener(this);

        goodsSortAllEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_SEARCH) {
                    //关闭软键盘
                    EditUtils.showORhideSoftKeyboard(GoodsSortAllActivity.this);
                    keyword = goodsSortAllEdit.getText().toString();
                    bzBeanList.clear();
                    bzTimeBeanList.clear();
                    tsBeanList.clear();
                    tsTimeBeanList.clear();
                    goodsSortAllZh.setSelected(true);
                    goodsSortAllTime.setSelected(false);
                    goodsSortAllHot.setSelected(false);
                    goodsSortAllShaixuan.setSelected(false);
                    initBzRvData(keyword);
                    bzShowRvAdapter.notifyDataSetChanged();
                    return true;
                }
                return false;
            }
        });
        searchAllSmartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
                pageNo = 1;
                if (goodsSortAllBz.isSelected()){
                    initBzRvData(keyword);
                    searchAllSmartRefreshLayout.finishRefresh(1000);
                }else if (goodsSortAllTs.isSelected()){
                    initTsRvData(keyword);
                    searchAllSmartRefreshLayout.finishRefresh(1000);
                }else if (goodsSortAllWd.isSelected()){
                    initWdRvData(keyword);
                    searchAllSmartRefreshLayout.finishRefresh(1000);
                }else if (goodsSortAllGj.isSelected()){
                    initGjRvData(keyword);
                    searchAllSmartRefreshLayout.finishRefresh(1000);
                }
            }
        });
        searchAllSmartRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
                ++pageNo;
                if (goodsSortAllBz.isSelected()){
                    initBzRvData(keyword);
                    searchAllSmartRefreshLayout.finishLoadMore(1000);
                }else if (goodsSortAllTs.isSelected()){
                    initTsRvData(keyword);
                    searchAllSmartRefreshLayout.finishLoadMore(1000);
                }else if (goodsSortAllWd.isSelected()){
                    initWdRvData(keyword);
                    searchAllSmartRefreshLayout.finishLoadMore(1000);
                }else if (goodsSortAllGj.isSelected()){
                    initGjRvData(keyword);
                    searchAllSmartRefreshLayout.finishLoadMore(1000);
                }
            }
        });
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_goods_sort_all;
    }

    @Override
    protected void initView() {
    }

    @Override
    protected void addListener() {
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id) {
            case R.id.goods_sort_all_back:
                finish();
                break;
            case R.id.goods_sort_all_fenlei:
                Intent fenleiIntent = new Intent(this, GoodsSortActivity.class);
                startActivity(fenleiIntent);
                finish();
                break;

            case R.id.goods_sort_all_zh:
                goodsSortAllZh.setSelected(true);
                goodsSortAllTime.setSelected(false);
                goodsSortAllHot.setSelected(false);
                goodsSortAllShaixuan.setSelected(false);
                setSortTimeDrawable(R.mipmap.goods_sort_time_sort);
                if (currentState == 1) {
                    setAllListClear();
                    initBzRvData(keyword);
                } else if (currentState == 2) {
                    setAllListClear();
                    initTsRvData(keyword);
                } else if (currentState == 3) {
                    setAllListClear();
                    initWdRvData(keyword);
                } else {
                    setAllListClear();
                    initGjRvData(keyword);
                }
                break;
            case R.id.goods_sort_all_time:
                goodsSortAllZh.setSelected(false);
                goodsSortAllTime.setSelected(true);
                goodsSortAllHot.setSelected(false);
                goodsSortAllShaixuan.setSelected(false);
                setAllListClear();
                if (currentState == 1) {
                    if (bzTimeFlag) {
                        loadBzTimeData(1, keyword);
                        setSortTimeDrawable(R.mipmap.down_time_sort2x);
                    } else {
                        loadBzTimeData(2, keyword);
                        setSortTimeDrawable(R.mipmap.up_time_sort2x);
                    }
                    bzTimeFlag = !bzTimeFlag;
                } else if (currentState == 2) {
                    if (tsTimeFlag) {
                        initTsTimeData(0, keyword);
                        setSortTimeDrawable(R.mipmap.down_time_sort2x);
                    } else {
                        initTsTimeData(1, keyword);
                        setSortTimeDrawable(R.mipmap.up_time_sort2x);
                    }
                    tsTimeFlag = !tsTimeFlag;
                } else if (currentState == 3) {
                    if (wdTimeFlag) {
                        setSortTimeDrawable(R.mipmap.down_time_sort2x);
                    } else {
                        setSortTimeDrawable(R.mipmap.up_time_sort2x);
                    }
                    wdTimeFlag = !wdTimeFlag;
                    initWdRvData(keyword);
                } else {
                    setAllListClear();
                    if (timeFlag) {
                        setSortTimeDrawable(R.mipmap.down_time_sort2x);
                    } else {
                        setSortTimeDrawable(R.mipmap.up_time_sort2x);
                    }
                    timeFlag = !timeFlag;
                    initGjRvData(keyword);
                }
                break;
            case R.id.goods_sort_all_hot:
                goodsSortAllZh.setSelected(false);
                goodsSortAllTime.setSelected(false);
                goodsSortAllHot.setSelected(true);
                goodsSortAllShaixuan.setSelected(false);
                setSortTimeDrawable(R.mipmap.goods_sort_time_sort);
                setAllListClear();
                if (currentState == 1) {
                    initBzRvData(keyword);
                } else if (currentState == 2) {
                    initTsRvData(keyword);
                } else if (currentState == 3) {
                    initWdRvData(keyword);
                } else {
                    initGjRvData(keyword);
                }
                break;
            case R.id.goods_sort_all_shaixuan:
                goodsSortAllZh.setSelected(false);
                goodsSortAllTime.setSelected(false);
                goodsSortAllHot.setSelected(false);
                goodsSortAllShaixuan.setSelected(true);
                setSortTimeDrawable(R.mipmap.goods_sort_time_sort);
                setDrawerListClear();
                if (currentState == 1) {
                    shopDrawerBz.setVisibility(View.VISIBLE);
                    shopDrawerTs.setVisibility(View.GONE);
                    shopDrawerWd.setVisibility(View.GONE);
                    shopDrawerGj.setVisibility(View.GONE);
                } else if (currentState == 2) {
                    shopDrawerBz.setVisibility(View.GONE);
                    shopDrawerTs.setVisibility(View.VISIBLE);
                    shopDrawerWd.setVisibility(View.GONE);
                    shopDrawerGj.setVisibility(View.GONE);
                    getTsDrawerData();
                } else if (currentState == 3) {
                    shopDrawerBz.setVisibility(View.GONE);
                    shopDrawerTs.setVisibility(View.GONE);
                    shopDrawerWd.setVisibility(View.VISIBLE);
                    shopDrawerGj.setVisibility(View.GONE);
                    initWdDrawerData();
                } else {
                    shopDrawerBz.setVisibility(View.GONE);
                    shopDrawerTs.setVisibility(View.GONE);
                    shopDrawerWd.setVisibility(View.GONE);
                    shopDrawerGj.setVisibility(View.VISIBLE);
                    initGjDrawData();
                }
                goodsSortAllDrawerLayout.openDrawer(GravityCompat.END);
                break;

            case R.id.goods_sort_all_bz:
                goodsSortAllBz.setSelected(true);
                goodsSortAllTs.setSelected(false);
                goodsSortAllWd.setSelected(false);
                goodsSortAllGj.setSelected(false);
                currentState = 1;
                setAllListClear();
                initBzRvData(keyword);
                loadCarData();
                carView.show();
                break;
            case R.id.goods_sort_all_ts:
                goodsSortAllBz.setSelected(false);
                goodsSortAllTs.setSelected(true);
                goodsSortAllWd.setSelected(false);
                goodsSortAllGj.setSelected(false);
                currentState = 2;
                setAllListClear();
                initTsRvData(keyword);
                loadCarData();
                carView.show();
                break;
            case R.id.goods_sort_all_wd:
                goodsSortAllBz.setSelected(false);
                goodsSortAllTs.setSelected(false);
                goodsSortAllWd.setSelected(true);
                goodsSortAllGj.setSelected(false);
                currentState = 3;
                setAllListClear();
                initWdRvData(keyword);
                loadCarData();
                carView.show();
                break;
            case R.id.goods_sort_all_gj:
                goodsSortAllBz.setSelected(false);
                goodsSortAllTs.setSelected(false);
                goodsSortAllWd.setSelected(false);
                goodsSortAllGj.setSelected(true);
                currentState = 4;
                setAllListClear();
                initGjRvData(keyword);
                carView.hide();
                break;

            //标准
            //发布start时间
            case R.id.goods_sort_bz_drawer_fabu_start:
                View view = LayoutInflater.from(this).inflate(R.layout.view_datepicker, null);
                commonPop(view);
                for (int i = 0; i < bzTimeList.size(); i++) {
                    bzTimeList.get(i).setClickable(false);
                }
                bzDrawerUptimeAdapter.notifyDataSetChanged();
                break;
            case R.id.goods_sort_bz_drawer_fabu_end:
                View view1 = LayoutInflater.from(this).inflate(R.layout.view_datepicker, null);
                commonPop1(view1);
                for (int i = 0; i < bzTimeList.size(); i++) {
                    bzTimeList.get(i).setClickable(false);
                }
                bzDrawerUptimeAdapter.notifyDataSetChanged();
                break;
            case R.id.goods_sort_bz_drawer_shishi_start:
                View view2 = LayoutInflater.from(this).inflate(R.layout.view_datepicker, null);
                commonPop2(view2);
                for (int i = 0; i < bzTimeList1.size(); i++) {
                    bzTimeList1.get(i).setClickable(false);
                }
                bzDrawerDowntimeAdapter.notifyDataSetChanged();
                break;
            case R.id.goods_sort_bz_drawer_shishi_end:
                View view3 = LayoutInflater.from(this).inflate(R.layout.view_datepicker, null);
                commonPop3(view3);
                for (int i = 0; i < bzTimeList1.size(); i++) {
                    bzTimeList1.get(i).setClickable(false);
                }
                bzDrawerDowntimeAdapter.notifyDataSetChanged();
                break;
            //清空重置
            case R.id.goods_sort_bz_drawer_Reset:
                goodsSortBzDrawerZhankai.setText("全部  ");
                for (int i = 0; i < bzStateList.size(); i++) {
                    bzStateList.get(i).setClickable(true);
                    bzStateList.get(i).setFlag(false);
                }
                goodsSortBzDrawerFabuStart.setText("起始日期");
                goodsSortBzDrawerFabuEnd.setText("截止日期");
                goodsSortBzDrawerShishiStart.setText("起始日期");
                goodsSortBzDrawerShishiEnd.setText("截止日期");
                for (int j = 0; j < bzTimeList.size(); j++) {
                    bzTimeList.get(j).setFlag(false);
                    bzTimeList.get(j).setClickable(true);
                }
                bzDrawerUptimeAdapter.notifyDataSetChanged();
                for (int k = 0; k < bzTimeList1.size(); k++) {
                    bzTimeList1.get(k).setFlag(false);
                    bzTimeList1.get(k).setClickable(true);
                }
                bzDrawerDowntimeAdapter.notifyDataSetChanged();
                goodsSortBzDrawerQicaoEdit.setText("");
                goodsSortBzDrawerDanweiEdit.setText("");
                goodsSortBzDrawerZhubanEdit.setText("");
                goodsSortBzDrawerZhubianEdit.setText("");
                bzDrawerStateAdapter.notifyDataSetChanged();
                break;
            //确认
            case R.id.goods_sort_bz_drawer_Sure:
                initBzSureData();
                goodsSortAllDrawerLayout.closeDrawer(GravityCompat.END);
                break;

            //图书
            case R.id.goods_sort_ts_drawer_fenlei_tv:
                if (tsDrawerFenLeiRvAdapter.getItemCount() == 6) {
                    tsDrawerFenLeiRvAdapter.addItemNums(tsTsFenLeiDrawerList.size());
                    tsDrawerFenLeiRvAdapter.notifyDataSetChanged();
                    goodsSortTsDrawerFenleiTv.setText("收回  ");
                } else {
                    tsDrawerFenLeiRvAdapter.addItemNums(6);
                    tsDrawerFenLeiRvAdapter.notifyDataSetChanged();
                    goodsSortTsDrawerFenleiTv.setText("全部  ");
                }
                tsDrawerFenLeiRvAdapter.notifyDataSetChanged();
                break;
            case R.id.goods_sort_ts_drawer_chubanshe_tv:
                if (tsDrawerChuBanSheRvAdapter.getItemCount() == 6) {
                    tsDrawerChuBanSheRvAdapter.addItemNums(tsChuBanSheDrawerList.size());
                    tsDrawerChuBanSheRvAdapter.notifyDataSetChanged();
                } else {
                    tsDrawerChuBanSheRvAdapter.addItemNums(6);
                    tsDrawerChuBanSheRvAdapter.notifyDataSetChanged();
                    goodsSortTsDrawerChubansheTv.setText("全部  ");
                }
                tsDrawerChuBanSheRvAdapter.notifyDataSetChanged();
                break;
            case R.id.goods_sort_ts_drawer_chubantime_start:
                View view4 = LayoutInflater.from(this).inflate(R.layout.view_datepicker, null);
                commonPop4(view4);
                break;
            case R.id.goods_sort_ts_drawer_chubantime_end:
                View view5 = LayoutInflater.from(this).inflate(R.layout.view_datepicker, null);
                commonPop5(view5);
                break;
            case R.id.goods_sort_ts_drawer_Reset:
                goodsSortTsDrawerFenleiTv.setText("全部  ");
                goodsSortTsDrawerChubansheTv.setText("全部  ");
                goodsSortTsDrawerChubantimeStart.setText("起始日期");
                goodsSortTsDrawerChubantimeEnd.setText("截止日期");
                for (int i = 0; i < tsTsFenLeiDrawerList.size(); i++) {
                    tsTsFenLeiDrawerList.get(i).setSelected(false);
                }
                tsDrawerFenLeiRvAdapter.notifyDataSetChanged();
                for (int i = 0; i < tsChuBanSheDrawerList.size(); i++) {
                    tsChuBanSheDrawerList.get(i).setFlag(false);
                }
                tsDrawerChuBanSheRvAdapter.notifyDataSetChanged();
                for (int i = 0; i < tsTimeDrawerList.size(); i++) {
                    tsTimeDrawerList.get(i).setFlag(false);
                }
                tsDrawerDateRvAdapter.notifyDataSetChanged();
                break;
            case R.id.goods_sort_ts_drawer_Sure:
                initTsSureData();
                goodsSortAllDrawerLayout.closeDrawer(GravityCompat.END);
                break;

            //文档
            case R.id.goods_sort_wd_drawer_Reset:
                setWdReset();
                break;
            case R.id.goods_sort_wd_drawer_Sure:
                initWdSureData();
                goodsSortAllDrawerLayout.closeDrawer(GravityCompat.END);
                break;

            //软件工具
            case R.id.goods_sort_gj_drawer_Reset:
                setGjReset();
                break;
            case R.id.goods_sort_gj_drawer_Sure:
                setAllListClear();
                initGjSureData();
                goodsSortAllDrawerLayout.closeDrawer(GravityCompat.END);
                break;
        }
    }

    private void setDrawerListClear() {
        tsTimeDrawerList.clear();
        tsChuBanSheDrawerList.clear();
        tsTsFenLeiDrawerList.clear();
        wdDrwerList.clear();
        useTimeList.clear();
        usageModeList.clear();
        versionInformationList.clear();
        priceNegotiableList.clear();
        subCategoryBeanList.clear();
        platformCarrierList.clear();
    }

    private void setSortTimeDrawable(int p) {
        Drawable downTime = getResources().getDrawable(p);
        downTime.setBounds(0, 0, downTime.getMinimumWidth(), downTime.getMinimumHeight());
        goodsSortAllTime.setCompoundDrawables(null, null, downTime, null);
    }

    private void setAllListClear() {
        bzBeanList.clear();
        bzTimeBeanList.clear();
        bzShaiXuanBeanList.clear();
        tsBeanList.clear();
        tsTimeBeanList.clear();
        tsSxList.clear();
        wdBeanList.clear();
        wdSxBeanList.clear();
        gjBeanList.clear();
        gjSxBeanList.clear();
    }

    private void initOtherAdapter() {
        GoodsSortDrawerBean timeBean1 = new GoodsSortDrawerBean("近一个月", "60", false, true);
        GoodsSortDrawerBean timeBean2 = new GoodsSortDrawerBean("近三个月", "60", false, true);
        GoodsSortDrawerBean timeBean3 = new GoodsSortDrawerBean("近半年", "60", false, true);
        GoodsSortDrawerBean timeBean4 = new GoodsSortDrawerBean("近一年", "60", false, true);

        bzTimeList.add(timeBean1);
        bzTimeList.add(timeBean2);
        bzTimeList.add(timeBean3);
        bzTimeList.add(timeBean4);

        GoodsSortDrawerBean timeBean5 = new GoodsSortDrawerBean("近一个月", "61", false, true);
        GoodsSortDrawerBean timeBean6 = new GoodsSortDrawerBean("近三个月", "61", false, true);
        GoodsSortDrawerBean timeBean7 = new GoodsSortDrawerBean("近半年", "61", false, true);
        GoodsSortDrawerBean timeBean8 = new GoodsSortDrawerBean("近一年", "61", false, true);
        bzTimeList1.add(timeBean5);
        bzTimeList1.add(timeBean6);
        bzTimeList1.add(timeBean7);
        bzTimeList1.add(timeBean8);

        GoodsSortDrawerBean stateBean1 = new GoodsSortDrawerBean("标准", "53", false, true);
        GoodsSortDrawerBean stateBean2 = new GoodsSortDrawerBean("废止", "53", false, true);
        GoodsSortDrawerBean stateBean3 = new GoodsSortDrawerBean("限制", "53", false, true);
        bzStateList.add(stateBean1);
        bzStateList.add(stateBean2);
        bzStateList.add(stateBean3);

        bzDrawerUptimeAdapter = new GoodsSortBzDrawerUpTimeRvAdapter(this, bzTimeList);
        bzDrawerUptimeAdapter.setGoodsSortBzDrawerUpTimeListener(this);
        bzDrawerStateAdapter = new GoodsSortBzDrawerStateRvAdapter(this, bzStateList);
        bzDrawerStateAdapter.setGoodsSortBzDrawerStateListener(this);
        bzDrawerDowntimeAdapter = new GoodsSortBzDrawerDownTimeRvAdapter(this, bzTimeList1);
        bzDrawerDowntimeAdapter.setGoodsSortBzDrawerDownTimeListener(this);
        //标准状态
        GridLayoutManager gridLayoutManager2 = new GridLayoutManager(this, 3);
        goodsSortBzDrawerTopRv.setLayoutManager(gridLayoutManager2);
        goodsSortBzDrawerTopRv.setAdapter(bzDrawerStateAdapter);
        //发布日期
        GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
        goodsSortBzDrawerFabuRv.setLayoutManager(gridLayoutManager);
        goodsSortBzDrawerFabuRv.setAdapter(bzDrawerUptimeAdapter);
        //实施日期
        GridLayoutManager gridLayoutManager1 = new GridLayoutManager(this, 3);
        goodsSortBzDrawerShishiRv.setLayoutManager(gridLayoutManager1);
        goodsSortBzDrawerShishiRv.setAdapter(bzDrawerDowntimeAdapter);

        //图书
        GridLayoutManager tsFenLeiManager = new GridLayoutManager(this, 3);
        goodsSortTsDrawerFenleiRv.setLayoutManager(tsFenLeiManager);
        tsDrawerFenLeiRvAdapter = new GoodsSortTsDrawerFenLeiRvAdapter(this);
        goodsSortTsDrawerFenleiRv.setAdapter(tsDrawerFenLeiRvAdapter);
        tsDrawerFenLeiRvAdapter.setGoodsSortBzDrawerFenLeiListener(this);

        GridLayoutManager tsChuBanSheManager = new GridLayoutManager(this, 2);
        goodsSortTsDrawerChubansheRv.setLayoutManager(tsChuBanSheManager);
        tsDrawerChuBanSheRvAdapter = new GoodsSortTsDrawerChuBanSheRvAdapter(this);
        goodsSortTsDrawerChubansheRv.setAdapter(tsDrawerChuBanSheRvAdapter);
        tsDrawerChuBanSheRvAdapter.setGoodsSortBzDrawerStateListener(this);

        GridLayoutManager tsDateManager = new GridLayoutManager(this, 3);
        goodsSortTsDrawerChubantimeRv.setLayoutManager(tsDateManager);
        tsDrawerDateRvAdapter = new GoodsSortTsDrawerDateRvAdapter(this);
        goodsSortTsDrawerChubantimeRv.setAdapter(tsDrawerDateRvAdapter);
        tsDrawerDateRvAdapter.setGoodsSortBzDrawerDateListener(this);

        //文档
        GridLayoutManager manager = new GridLayoutManager(this, 3);
        goodsSortWdDrawerFenleiRv.setLayoutManager(manager);
        wdDrawerRvAdapter = new GoodsSortWdDrawerRvAdapter(this);
        wdDrawerRvAdapter.setGoodsSortWdDrawerListener(this);
        goodsSortWdDrawerFenleiRv.setAdapter(wdDrawerRvAdapter);
        wdDrawerRvAdapter.setGoodsSortWdDrawerListener(this);

        //软件工具

        //软件产品
        GridLayoutManager rjcpManager = new GridLayoutManager(this, 3);
        goodsSortGjDrawerRuanjianchanpinRv.setLayoutManager(rjcpManager);
        rjcpAdapter = new GoodsSortGjDrawerRJCPAdapter(this);
        goodsSortGjDrawerRuanjianchanpinRv.setAdapter(rjcpAdapter);
        //使用方式
        GridLayoutManager usageModeManager = new GridLayoutManager(this, 3);
        goodsSortGjDrawerShiyongfangshiRv.setLayoutManager(usageModeManager);
        usageModeAdapter = new GoodsSortGjDrawerUsageModeAdapter(this);
        goodsSortGjDrawerShiyongfangshiRv.setAdapter(usageModeAdapter);
        //版本信息
        GridLayoutManager versionInformationManager = new GridLayoutManager(this, 3);
        goodsSortGjDrawerBanbenxinxiRv.setLayoutManager(versionInformationManager);
        versionInformationAdapter = new GoodsSortGjDrawerVersionInformationAdapter(this);
        goodsSortGjDrawerBanbenxinxiRv.setAdapter(versionInformationAdapter);
        //使用时效
        GridLayoutManager useTimeManager = new GridLayoutManager(this, 3);
        goodsSortGjDrawerShiyongshixiaoRv.setLayoutManager(useTimeManager);
        useTimeAdapter = new GoodsSortGjDrawerUseTimeAdapter(this);
        goodsSortGjDrawerShiyongshixiaoRv.setAdapter(useTimeAdapter);
        //价格面议
        GridLayoutManager priceNegotiableManager = new GridLayoutManager(this, 3);
        goodsSortGjDrawerJiagemianyiRv.setLayoutManager(priceNegotiableManager);
        priceMianYiAdapter = new GoodsSortGjDrawerPriceMianYiAdapter(this);
        goodsSortGjDrawerJiagemianyiRv.setAdapter(priceMianYiAdapter);
        //平台载体
//        GridLayoutManager platformCarrierManager = new GridLayoutManager(this, 3);
        goodsSortGjDrawerPingtaizaitiRv.setLayoutManager(new LinearLayoutManager(this));
        platformCarrierAdapter = new GoodsSortGjDrawerPlatformCarrierAdapter(this);
        goodsSortGjDrawerPingtaizaitiRv.setAdapter(platformCarrierAdapter);

        rjcpAdapter.setGoodsSortGjDrawerRJCPListener(this);
        usageModeAdapter.setGoodsSortGjDrawerUsageModeListener(this);
        useTimeAdapter.setGoodsSortGjDrawerUseTimeListener(this);
        priceMianYiAdapter.setGoodsSortGjDrawerPriceMianYiListener(this);
        versionInformationAdapter.setGoodsSortGjDrawerVersionInformationListener(this);
        platformCarrierAdapter.setGoodsSortGjDrawerPriceMianYiListener(this);
    }

    @Override
    public void addBzCar(String skuStr,GoodsSortBzShowRvAdapter.GoodsSortBzShowRvViewHolder holder) {
        AddCar(skuStr);
    }

    @Override
    public void addBzTimeCar(String skuStr,GoodsSortBzShowTimeRvAdapter.GoodsSortBzShowRvViewHolder holder) {
//        addBzCar(skuStr);
        AddCar(skuStr);
    }

    @Override
    public void onUpTimeClick(int index) {
        for (int i = 0; i < bzTimeList.size(); i++) {
            if (i == index)
                bzTimeList.get(i).setFlag(!bzTimeList.get(i).isFlag());
            else
                bzTimeList.get(i).setFlag(false);
        }
        if (bzTimeList.get(index).isFlag()) {
            goodsSortBzDrawerFabuStart.setClickable(false);
            goodsSortBzDrawerFabuEnd.setClickable(false);
        } else {
            goodsSortBzDrawerFabuStart.setClickable(true);
            goodsSortBzDrawerFabuEnd.setClickable(true);
        }
        bzDrawerUptimeAdapter.notifyDataSetChanged();
    }

    @Override
    public void onStateClick(int index) {
        for (int i = 0; i < bzStateList.size(); i++) {
            if (i == index) {
                bzStateList.get(i).setFlag(!bzStateList.get(i).isFlag());
            } else {
                bzStateList.get(i).setFlag(false);
            }
        }
        goodsSortBzDrawerZhankai.setText(bzStateList.get(index).getS() + "  ");
        bzDrawerStateAdapter.notifyDataSetChanged();
    }

    @Override
    public void onDownTime(int index) {
        for (int i = 0; i < bzTimeList1.size(); i++) {
            if (i == index)
                bzTimeList1.get(i).setFlag(!bzTimeList1.get(i).isFlag());
            else
                bzTimeList1.get(i).setFlag(false);
        }
        if (bzTimeList1.get(index).isFlag()) {
            goodsSortBzDrawerShishiStart.setClickable(false);
            goodsSortBzDrawerShishiEnd.setClickable(false);
        } else {
            goodsSortBzDrawerShishiStart.setClickable(true);
            goodsSortBzDrawerShishiEnd.setClickable(true);
        }
        bzDrawerDowntimeAdapter.notifyDataSetChanged();
    }

    //时间选择弹窗
    private void commonPop(View view) {
        PopupWindow popupWindow = new PopupWindow(view, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT, true);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
//        getWindow().setAttributes(lp);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setOutsideTouchable(true);
        popupWindow.setTouchable(true);
        //从下往上弹出动画效果
        popupWindow.setAnimationStyle(R.style.bottomPopupAnimation);
        popupWindow.showAtLocation(findViewById(R.id.goods_sort_bz_drawer), Gravity.BOTTOM, 0, 0);

        DatePicker picker = view.findViewById(R.id.datePicker_picker);
        picker.init(2019, 8, 1, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Log.e("cjx", year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
                goodsSortBzDrawerFabuStart.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
            }
        });
    }

    //时间选择弹窗
    private void commonPop1(View view) {
        PopupWindow popupWindow = new PopupWindow(view, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT, true);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
//        getWindow().setAttributes(lp);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setOutsideTouchable(true);
        popupWindow.setTouchable(true);
        //从下往上弹出动画效果
        popupWindow.setAnimationStyle(R.style.bottomPopupAnimation);
        popupWindow.showAtLocation(findViewById(R.id.goods_sort_bz_drawer), Gravity.BOTTOM, 0, 0);

        DatePicker picker = view.findViewById(R.id.datePicker_picker);
        picker.init(2019, 8, 1, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Log.e("cjx", year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
                goodsSortBzDrawerFabuEnd.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
            }
        });
    }

    //时间选择弹窗
    private void commonPop2(View view) {
        PopupWindow popupWindow = new PopupWindow(view, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT, true);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
//        getWindow().setAttributes(lp);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setOutsideTouchable(true);
        popupWindow.setTouchable(true);
        //从下往上弹出动画效果
        popupWindow.setAnimationStyle(R.style.bottomPopupAnimation);
        popupWindow.showAtLocation(findViewById(R.id.goods_sort_bz_drawer), Gravity.BOTTOM, 0, 0);
        DatePicker picker = view.findViewById(R.id.datePicker_picker);
        picker.init(2019, 8, 1, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Log.e("cjx", year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
                goodsSortBzDrawerShishiStart.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
            }
        });
    }

    //时间选择弹窗
    private void commonPop3(View view) {
        PopupWindow popupWindow = new PopupWindow(view, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT, true);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
//        getWindow().setAttributes(lp);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setOutsideTouchable(true);
        popupWindow.setTouchable(true);
        //从下往上弹出动画效果
        popupWindow.setAnimationStyle(R.style.bottomPopupAnimation);
        popupWindow.showAtLocation(findViewById(R.id.goods_sort_bz_drawer), Gravity.BOTTOM, 0, 0);
        DatePicker picker = view.findViewById(R.id.datePicker_picker);
        picker.init(2019, 8, 1, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Log.e("cjx", year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
                goodsSortBzDrawerShishiEnd.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
            }
        });
    }

    //时间选择弹窗
    private void commonPop4(View view) {
        PopupWindow popupWindow = new PopupWindow(view, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT, true);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
//        getWindow().setAttributes(lp);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setOutsideTouchable(true);
        popupWindow.setTouchable(true);
        //从下往上弹出动画效果
        popupWindow.setAnimationStyle(R.style.bottomPopupAnimation);
        popupWindow.showAtLocation(findViewById(R.id.goods_sort_bz_drawer), Gravity.BOTTOM, 0, 0);
        DatePicker picker = view.findViewById(R.id.datePicker_picker);
        picker.init(2019, 8, 1, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Log.e("cjx", year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
                goodsSortTsDrawerChubantimeStart.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
            }
        });
    }

    //时间选择弹窗
    private void commonPop5(View view) {
        PopupWindow popupWindow = new PopupWindow(view, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT, true);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
//        getWindow().setAttributes(lp);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setOutsideTouchable(true);
        popupWindow.setTouchable(true);
        //从下往上弹出动画效果
        popupWindow.setAnimationStyle(R.style.bottomPopupAnimation);
        popupWindow.showAtLocation(findViewById(R.id.goods_sort_bz_drawer), Gravity.BOTTOM, 0, 0);
        DatePicker picker = view.findViewById(R.id.datePicker_picker);
        picker.init(2019, 8, 1, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                Log.e("cjx", year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
                goodsSortTsDrawerChubantimeEnd.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
            }
        });
    }

    //添加购物车
    private void AddCar(String skuStr) {
        Log.e("cjx", "skuStr:" + skuStr);
        if (!getSharedPreferencesUtil().getLogintoken().isEmpty()) {
            Map<String, String> map = new HashMap<>();
            map.put("skuStr", skuStr);
            map.put("orderType", 4 + "");
//            是否再次购买（0/1）
            map.put("buyAgain", 0 + "");
            map.put("token", getSharedPreferencesUtil().getLogintoken());
            map.put("deviceId", DeviceUtils.getIMEString(context));
            AddCarApi addCarApi = new AddCarApi(GoodsSortAllActivity.this, simpleOnNextListenerAddCar);
            addCarApi.setCache(false);
            addCarApi.setMap(map);

            HttpManager.getInstance().doHttpDeal(addCarApi);

        }else {
            Map<String, String> map = new HashMap<>();
            map.put("skuStr", skuStr);
            map.put("orderType", 4 + "");
//            是否再次购买（0/1）
            map.put("buyAgain", 0 + "");
            map.put("token", "");
            map.put("deviceId", DeviceUtils.getIMEString(context));
            final AddCarApi addCarApi = new AddCarApi(GoodsSortAllActivity.this, simpleOnNextListenerAddCar);
            addCarApi.setCache(false);
            addCarApi.setMap(map);
            HttpManager.getInstance().doHttpDeal(addCarApi);
        }
    }

    //添加购物车
    HttpOnNextListener simpleOnNextListenerAddCar = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {

            if (!subjects.getCode().equals(ConstantsUtils.STATUS_SUCCESS_0000)) {
                ToastTools.showToast(context, subjects.getMsg());
                return;
            }
            double currentCarNumber = (double) subjects.getData();
            Log.e("cjx", "currentCarNumber:" + currentCarNumber + "");
            int i = (int) currentCarNumber;
            carTv.setText(i + "");
            ToastTools.showToast("");
        }

        @Override
        public void onCacheNext(String cache) {

        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", e.getMessage());
        }
    };

    @Override
    protected void onResume() {
        loadCarData();
        super.onResume();
    }

    //获取购物车列表数据
    private void loadCarData() {
        if (!getSharedPreferencesUtil().getLogintoken().isEmpty()) {
            final ShoppingCarListApi shoppingCarListApi = new ShoppingCarListApi(this, simpleOnNextListener, SharedPreferencesUtil.getLoginToken(), DeviceUtils.getIMEString(GoodsSortAllActivity.this));
            shoppingCarListApi.setCache(false);
            HttpManager.getInstance().doHttpDeal(shoppingCarListApi);
        }else {
            final ShoppingCarListApi shoppingCarListApi = new ShoppingCarListApi(this, simpleOnNextListener, "", DeviceUtils.getIMEString(GoodsSortAllActivity.this));
            shoppingCarListApi.setCache(false);
            HttpManager.getInstance().doHttpDeal(shoppingCarListApi);
        }
    }

    //获取购物车列表数据监听
    HttpOnNextListener simpleOnNextListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals(ConstantsUtils.STATUS_SUCCESS_0000)) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", subjects.getMsg());
                return;
            }
            ShoppingCarListBean bean = (ShoppingCarListBean) subjects.getData();
            int size = bean.getCartList().size();
            int num=0;
            for (int i = 0; i < size; i++) {
                int goodsNumber = bean.getCartList().get(i).getGoodsNumber();
                num+=goodsNumber;
            }
            Log.e("cjx", "初始数量：" + size + "");
            carTv.setText(num + "");
            goodsSortAllLoadingLayout.setStatus(LoadingLayout.SUCCESS);
            carView.show();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "Bz购物车列表数据：" + e.getMessage());
            if (e instanceof SocketTimeoutException || e instanceof ConnectException) {
                goodsSortAllLoadingLayout.setStatus(LoadingLayout.NO_NETWORK);
            } else {
                goodsSortAllLoadingLayout.setStatus(LoadingLayout.ERROR);
            }
        }
    };

    //标准
    private void initBzRvData(String text) {
        searchAllApi = new GoodsSortSearchAllBzApi(GoodsSortAllActivity.this, searchAllListener, "1", 1, text,pageNo,10);
        Log.e("cjx", "bzkeyWord:" + keyword);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    //获取标准数据监听
    HttpOnNextListener<BaseResultEntity> searchAllListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "biaozhun数据：" + subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllBzBean> beans = (ArrayList<GoodsSortSearchAllBzBean>) subjects.getData();
            bzBeanList.addAll(beans.get(0).getData());
            Log.e("cjx", "biaozhun数据长度：" + bzBeanList.size() + "");
            //主界面数据
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            bzShowRvAdapter = new GoodsSortBzShowRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(bzShowRvAdapter);
            bzShowRvAdapter.setGoodsBzRvListener(GoodsSortAllActivity.this);
            bzShowRvAdapter.setBeanList(bzBeanList);
            bzShowRvAdapter.notifyDataSetChanged();
            goodsSortAllLoadingLayout.setStatus(LoadingLayout.SUCCESS);
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "bz拿到数据" + e.getMessage());
            goodsSortAllLoadingLayout.setStatus(LoadingLayout.ERROR);
        }
    };

    //标准时间数据
    private void loadBzTimeData(int sort, String keyword) {
        GoodsSortSearchAllBzApi searchAllApi = new GoodsSortSearchAllBzApi(this, searchAllTimeListener, "2", 1, keyword, sort);
        Log.e("cjx", "bztimekeyWord:" + keyword);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    //获取标准时间数据监听
    HttpOnNextListener<BaseResultEntity> searchAllTimeListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllBzTimeBean> beans = (ArrayList<GoodsSortSearchAllBzTimeBean>) subjects.getData();
            bzTimeBeanList.addAll(beans.get(0).getData());
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            bzShowTimeRvAdapter = new GoodsSortBzShowTimeRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(bzShowTimeRvAdapter);
            bzShowTimeRvAdapter.setGoodsBzTimeRvListener(GoodsSortAllActivity.this);
            bzShowTimeRvAdapter.setTimeBeanList(bzTimeBeanList);
            bzShowTimeRvAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "bz时间数据error：" + e.getMessage());
        }
    };

    //图书
    @Override
    public void onTsDrawerChuBanSheSelected(int index) {
        for (int i = 0; i < tsChuBanSheDrawerList.size(); i++) {
            tsChuBanSheDrawerList.get(index).setFlag(!tsChuBanSheDrawerList.get(i).isFlag());
        }
        StringBuffer sb = new StringBuffer();
        for (int j = 0; j < tsChuBanSheDrawerList.size(); j++) {
            if (tsChuBanSheDrawerList.get(j).isFlag()) {
                sb.append(tsChuBanSheDrawerList.get(j).getS() + "丶");
            }
        }
        Log.e("cjx", "chubansheFlag:" + tsChuBanSheDrawerList.get(index).isFlag());
        goodsSortTsDrawerChubansheTv.setText(sb.toString());
        tsDrawerChuBanSheRvAdapter.notifyDataSetChanged();
    }

    @Override
    public void onTsDrawerDateSelected(int index) {
        for (int i = 0; i < tsTimeDrawerList.size(); i++) {
            if (i == index) {
                tsTimeDrawerList.get(i).setFlag(!tsTimeDrawerList.get(i).isFlag());
            } else {
                tsTimeDrawerList.get(i).setFlag(false);
            }
        }
        tsDrawerDateRvAdapter.notifyDataSetChanged();
    }

    @Override
    public void onTsFenLeiSelected(int index) {
        for (int i = 0; i < tsTsFenLeiDrawerList.size(); i++) {
            if (i == index) {
                tsTsFenLeiDrawerList.get(i).setSelected(!tsTsFenLeiDrawerList.get(i).isSelected());
            } else {
                tsTsFenLeiDrawerList.get(i).setSelected(false);
            }
        }
        goodsSortTsDrawerFenleiTv.setText(tsTsFenLeiDrawerList.get(index).getCatName() + "  ");
        tsDrawerFenLeiRvAdapter.notifyDataSetChanged();
    }

    @Override
    public void addTsCar(String skuStr,GoodsSortTsShowRvAdapter.GoodsSortTsShowRvViewHolder holder) {
        AddCar(skuStr);
    }

    @Override
    public void addTimeTsCar(String skuStr) {
        AddCar(skuStr);
    }

    //图书
    private void initTsRvData(String keyword) {
        GoodsSortSearchAllTsApi searchAllApi = new GoodsSortSearchAllTsApi(this, searchAllTsListener, 1, 2, "1", keyword,pageNo,10);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    //获取图书数据监听
    HttpOnNextListener<BaseResultEntity> searchAllTsListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "图书数据：" + subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllTsBean> beans = (ArrayList<GoodsSortSearchAllTsBean>) subjects.getData();
            subjects.getData();
            Log.e("cjx", "goodsTsList:" + beans.get(1).getData().size());
            tsBeanList.addAll(beans.get(1).getData());
            //主界面数据
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            tsShowRvAdapter = new GoodsSortTsShowRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(tsShowRvAdapter);
            tsShowRvAdapter.setGoodsTsRvListener(GoodsSortAllActivity.this);
            tsShowRvAdapter.setBeanList(tsBeanList);
            tsShowRvAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "bz拿到数据" + e.getMessage());
        }
    };

    private void initTsTimeData(int i, String keyword) {
        GoodsSortSearchAllTsApi searchAllApi = new GoodsSortSearchAllTsApi(this, searchAllTsTimeListener, 1, 2, i, "2", keyword);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    //获取图书数据监听
    HttpOnNextListener<BaseResultEntity> searchAllTsTimeListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "图书time数据：" + subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllTsTimeBean> beans = (ArrayList<GoodsSortSearchAllTsTimeBean>) subjects.getData();
            tsTimeBeanList.addAll(beans.get(1).getData());
            Log.e("cjx", "ts time数据长度：" + tsTimeBeanList.size() + "");
            //主界面数据
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            tsShowTimeRvAdapter = new GoodsSortTsTimeShowRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(tsShowTimeRvAdapter);
            tsShowTimeRvAdapter.setGoodsTsTimeRvListener(GoodsSortAllActivity.this);
            tsShowTimeRvAdapter.setTimeList(tsTimeBeanList);
            tsShowTimeRvAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "ts timelist拿到数据" + e.getMessage());
        }
    };


    private void getTsDrawerData() {
        SearchTsAttributeApi goodsSortApi = new SearchTsAttributeApi(this, delCartListener);
        goodsSortApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(goodsSortApi);
    }

    //获取图书属性数据监听
    HttpOnNextListener delCartListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                Log.e("cjx", "图书属性:" + subjects.getData());
                return;
            }
            SearchTsAttributeBean bean = (SearchTsAttributeBean) subjects.getData();
            Log.e("cjx", "图书属性拿到数据");
            tsTsFenLeiDrawerList.addAll(bean.getBookCat());
            tsDrawerFenLeiRvAdapter.setTsTsFenLeiDrawerList(tsTsFenLeiDrawerList);
            List<SearchTsAttributeBean.AllAttrListBean> allAttrDrawerList = bean.getAllAttrList();
            int attrId = bean.getAllAttrList().get(0).getAttrId();
            List<String> attrValuesList = allAttrDrawerList.get(0).getAttrValues();
            for (int i = 0; i < attrValuesList.size(); i++) {
                String s = attrValuesList.get(i);
                GoodsSortDrawerBean goodsSortDrawerBean = new GoodsSortDrawerBean(s, attrId + "", false, true);
                tsChuBanSheDrawerList.add(goodsSortDrawerBean);
            }
            tsDrawerChuBanSheRvAdapter.setTsTsFenLeiDrawerList(tsChuBanSheDrawerList);
            GoodsSortDrawerBean timeBean1 = new GoodsSortDrawerBean("近一个月", 95 + "", false, true);
            GoodsSortDrawerBean timeBean2 = new GoodsSortDrawerBean("近三个月", 95 + "", false, true);
            GoodsSortDrawerBean timeBean3 = new GoodsSortDrawerBean("近半年", 95 + "", false, true);
            GoodsSortDrawerBean timeBean4 = new GoodsSortDrawerBean("近一年", 95 + "", false, true);
            tsTimeDrawerList.add(timeBean1);
            tsTimeDrawerList.add(timeBean2);
            tsTimeDrawerList.add(timeBean3);
            tsTimeDrawerList.add(timeBean4);
            tsDrawerDateRvAdapter.setTsDrawerDateList(tsTimeDrawerList);
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "bz拿到数据" + e.getMessage());
        }
    };

    //文档
    @Override
    public void setRJCPSelected(int index) {
        for (int i = 0; i < wdDrwerList.size(); i++) {
            if (i == index)
                wdDrwerList.get(i).setSelected(!wdDrwerList.get(i).isSelected());
            else
                wdDrwerList.get(i).setSelected(false);
        }
        wdDrawerRvAdapter.notifyDataSetChanged();
    }

    @Override
    public void addWdCar(String skuStr) {
        AddCar(skuStr);
    }

    private void setWdReset() {
        for (int i = 0; i < wdDrwerList.size(); i++) {
            wdDrwerList.get(i).setSelected(false);
        }
        wdDrawerRvAdapter.notifyDataSetChanged();
    }

    //获取文档数据监听
    private void initWdRvData(String keyword) {
        GoodsSortSearchAllWdApi searchAllApi = new GoodsSortSearchAllWdApi(this, searchAllWdListener, 1, 2055, keyword,pageNo,10);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    HttpOnNextListener<BaseResultEntity> searchAllWdListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "文档数据：" + subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllWdBean> wdBeans = (ArrayList<GoodsSortSearchAllWdBean>) subjects.getData();
            wdBeanList.addAll(wdBeans.get(1).getData());
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            wdShowRvAdapter = new GoodsSortWdShowRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(wdShowRvAdapter);
            wdShowRvAdapter.setBeanList(wdBeanList);
            wdShowRvAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "wd数据" + e.getMessage());
        }
    };

    //获取文档属性数据监听
    private void initWdDrawerData() {
        GoodsSortWdDrawerApi wdDrawerApi = new GoodsSortWdDrawerApi(this, drawerBeanListener);
        wdDrawerApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(wdDrawerApi);
    }

    HttpOnNextListener<BaseResultEntity> drawerBeanListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "文档属性数据：" + subjects.getMsg());
                return;
            }
            wdDrwerList.addAll((ArrayList<GoodsSortWdDrwerBean>) subjects.getData());
            wdDrawerRvAdapter.setWdDrwerList(wdDrwerList);
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "wd属性数据" + e.getMessage());
        }
    };

    //软件工具
    @Override
    public void setPlatformCarrierListSelected(int index) {
        for (int i = 0; i < platformCarrierList.size(); i++) {
            if (i == index) {
                platformCarrierList.get(i).setSelected(!platformCarrierList.get(i).isSelected());
            } else {
                platformCarrierList.get(i).setSelected(false);
            }
        }
        platformCarrierAdapter.notifyDataSetChanged();
    }

    @Override
    public void setPriceMianYiListSelected(int index) {
        for (int i = 0; i < priceNegotiableList.size(); i++) {
            if (i == index) {
                priceNegotiableList.get(i).setSelected(!priceNegotiableList.get(i).isSelected());
            } else {
                priceNegotiableList.get(i).setSelected(false);
            }
        }
        priceMianYiAdapter.notifyDataSetChanged();
    }

    @Override
    public void setUsageModeListSelected(int index) {
        for (int i = 0; i < usageModeList.size(); i++) {
            if (i == index) {
                usageModeList.get(i).setSelected(!usageModeList.get(i).isSelected());
            } else {
                usageModeList.get(i).setSelected(false);
            }
        }
        usageModeAdapter.notifyDataSetChanged();
    }

    @Override
    public void setUseTimeSelected(int index) {
        for (int i = 0; i < useTimeList.size(); i++) {
            if (i == index) {
                useTimeList.get(i).setSelected(!useTimeList.get(i).isSelected());
            } else {
                useTimeList.get(i).setSelected(false);
            }
        }
        useTimeAdapter.notifyDataSetChanged();
    }

    @Override
    public void setVersionInformationListSelected(int index) {
        for (int i = 0; i < versionInformationList.size(); i++) {
            if (i == index) {
                versionInformationList.get(i).setSelected(!versionInformationList.get(i).isSelected());
            } else {
                versionInformationList.get(i).setSelected(false);
            }
        }
        versionInformationAdapter.notifyDataSetChanged();
    }

    @Override
    public void setWdDrawerSelected(int index) {
        for (int i = 0; i < subCategoryBeanList.size(); i++) {
            if (i == index) {
                subCategoryBeanList.get(i).setSelected(!subCategoryBeanList.get(i).isSelected());
            } else {
                subCategoryBeanList.get(i).setSelected(false);
            }
        }
        rjcpAdapter.notifyDataSetChanged();
    }

    @Override
    public void addGjCar(String skuStr) {
        AddCar(skuStr);
    }

    private void setGjReset() {
        for (int i = 0; i < platformCarrierList.size(); i++) {
            platformCarrierList.get(i).setSelected(false);
        }
        platformCarrierAdapter.notifyDataSetChanged();

        for (int i = 0; i < priceNegotiableList.size(); i++) {
            priceNegotiableList.get(i).setSelected(false);
        }
        priceMianYiAdapter.notifyDataSetChanged();

        for (int i = 0; i < useTimeList.size(); i++) {
            useTimeList.get(i).setSelected(false);
        }
        useTimeAdapter.notifyDataSetChanged();

        for (int i = 0; i < versionInformationList.size(); i++) {
            versionInformationList.get(i).setSelected(false);
        }
        versionInformationAdapter.notifyDataSetChanged();

        for (int i = 0; i < usageModeList.size(); i++) {
            usageModeList.get(i).setSelected(false);
        }
        usageModeAdapter.notifyDataSetChanged();

        for (int i = 0; i < subCategoryBeanList.size(); i++) {
            subCategoryBeanList.get(i).setSelected(false);
        }
        rjcpAdapter.notifyDataSetChanged();
    }

    //获取软件工具数据监听
    private void initGjRvData(String keyword) {
        GoodsSortSearchAllGjApi searchAllApi = new GoodsSortSearchAllGjApi(this, searchAllGjListener, 2, 456,pageNo,10);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    HttpOnNextListener<BaseResultEntity> searchAllGjListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "软件工具数据：" + subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllGjBean> gjBeans = (ArrayList<GoodsSortSearchAllGjBean>) subjects.getData();
            gjBeanList.addAll(gjBeans.get(1).getData());
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            showRvAdapter = new GoodsSortGjShowRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(showRvAdapter);
            showRvAdapter.setGoodsGjListener(GoodsSortAllActivity.this);
            showRvAdapter.setBeanList(gjBeanList);
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "软件工具数据" + e.getMessage());
        }
    };

    //获取软件工具属性数据监听
    private void initGjDrawData() {
        GoodsSortGjDrawerApi wdDrawerApi = new GoodsSortGjDrawerApi(this, gjDrawerBeanListener);
        wdDrawerApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(wdDrawerApi);
    }

    HttpOnNextListener<BaseResultEntity> gjDrawerBeanListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "软件工具属性数据：" + subjects.getMsg());
                return;
            }
            GoodsSortGjDrawerBean gjDrawerBean = (GoodsSortGjDrawerBean) subjects.getData();
            List<GoodsSortGjDrawerBean.AllAttrBean> allAttrBeanList = gjDrawerBean.getAllAttr();
            //软件产品
            subCategoryBeanList.addAll(gjDrawerBean.getCategory().get(0).getSubCategory());
            rjcpAdapter.setCategoryBeanList(subCategoryBeanList);
            //使用方式
            for (int n = 0; n < allAttrBeanList.get(0).getAttrValues().size(); n++) {
                int typeId = allAttrBeanList.get(0).getTypeId();
                String attrValue = allAttrBeanList.get(0).getAttrValues().get(n);
                GoodsSortGjDrawerOtherBean bean = new GoodsSortGjDrawerOtherBean(typeId, attrValue, false);
                usageModeList.add(bean);
            }
            Log.e("cjx", "usageModeList:" + usageModeList.size());
            //版本信息
            for (int k = 0; k < allAttrBeanList.get(1).getAttrValues().size(); k++) {
                int typeId = allAttrBeanList.get(1).getTypeId();
                String attrValue = allAttrBeanList.get(1).getAttrValues().get(k);
                GoodsSortGjDrawerOtherBean bean = new GoodsSortGjDrawerOtherBean(typeId, attrValue, false);
                versionInformationList.add(bean);
            }
            Log.e("cjx", "versionInformationList:" + versionInformationList.size());
            //使用时效
            for (int j = 0; j < allAttrBeanList.get(2).getAttrValues().size(); j++) {
                int typeId = allAttrBeanList.get(2).getTypeId();
                String attrValue = allAttrBeanList.get(2).getAttrValues().get(j);
                GoodsSortGjDrawerOtherBean bean = new GoodsSortGjDrawerOtherBean(typeId, attrValue, false);
                useTimeList.add(bean);
            }
            Log.e("cjx", "useTimeList:" + useTimeList.size());
            //价格面议
            for (int i = 0; i < allAttrBeanList.get(4).getAttrValues().size(); i++) {
                int typeId = allAttrBeanList.get(4).getTypeId();
                String attrValue = allAttrBeanList.get(4).getAttrValues().get(i);
                GoodsSortGjDrawerOtherBean bean = new GoodsSortGjDrawerOtherBean(typeId, attrValue, false);
                priceNegotiableList.add(bean);
            }
            Log.e("cjx", "priceNegotiableList:" + priceNegotiableList.size());
            //平台载体
            for (int y = 0; y < allAttrBeanList.get(3).getAttrValues().size(); y++) {
                int typeId = allAttrBeanList.get(3).getTypeId();
                String attrValue = allAttrBeanList.get(3).getAttrValues().get(y);
                GoodsSortGjDrawerOtherBean bean = new GoodsSortGjDrawerOtherBean(typeId, attrValue, false);
                platformCarrierList.add(bean);
            }
            Log.e("cjx", "platformCarrierList:" + platformCarrierList.size());

            priceMianYiAdapter.setPriceMianYiList(priceNegotiableList);
            usageModeAdapter.setUsageModeList(usageModeList);
            useTimeAdapter.setUseTimeList(useTimeList);
            versionInformationAdapter.setVersionInformationList(versionInformationList);
            platformCarrierAdapter.setPlatformCarrierList(platformCarrierList);
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "软件工具属性数据" + e.getMessage());
        }
    };

    //获取标准筛选数据
    private void initBzSureData() {
        String attrPro = getBzNowAttrPro();
        GoodsSortSearchAllBzSXApi searchAllSxApi = new GoodsSortSearchAllBzSXApi(this, searchAllBzSxListener, 1, attrPro);
        Log.e("cjx", "bztimekeyWord:" + keyword);
        searchAllSxApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllSxApi);
    }

    //获取标准筛选数据监听
    HttpOnNextListener<BaseResultEntity> searchAllBzSxListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                return;
            }
            setAllListClear();
            ArrayList<GoodsSortSearchAllBzSxBean> beans = (ArrayList<GoodsSortSearchAllBzSxBean>) subjects.getData();
            bzShaiXuanBeanList.addAll(beans.get(0).getData());
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            showBzSxRvAdapter = new GoodsSortBzShowSxRvAdapter(GoodsSortAllActivity.this);
            showBzSxRvAdapter.setGoodsBzSxRvListener(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(showBzSxRvAdapter);
            showBzSxRvAdapter.setSxList(bzShaiXuanBeanList);
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "bz时间数据error：" + e.getMessage());
        }
    };

    //获取当前筛选选中attrPro
    private String getBzNowAttrPro() {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < bzStateList.size(); i++) {
            if (bzStateList.get(i).isFlag()) {
                sb.append(bzStateList.get(i).getAttrId() + "__" + bzStateList.get(i).getS());
            }
        }
        if (goodsSortBzDrawerFabuStart.getText().toString().equals("起始日期") && goodsSortBzDrawerFabuEnd.getText().toString().equals("截止日期")) {
            for (int i = 0; i < bzTimeList.size(); i++) {
                if (bzTimeList.get(i).isFlag()) {
                    if (bzTimeList.get(i).getS().equals("近一个月")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(30);
                        sb.append("&start60__" + beforeDateTime);
                    } else if (bzTimeList.get(i).getS().equals("近三个月")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(90);
                        sb.append("&start60__" + beforeDateTime);
                    } else if (bzTimeList.get(i).getS().equals("近半年")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(180);
                        sb.append("&start60__" + beforeDateTime);
                    } else if (bzTimeList.get(i).getS().equals("近一年")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(365);
                        sb.append("&start60__" + beforeDateTime);
                    }
                    String nowDateTime = DateUtils.getNowDateTime();
                    sb.append("&end60__" + nowDateTime);
                }
            }

        } else {
            sb.append("&start60__" + goodsSortBzDrawerFabuStart.getText().toString());
            sb.append("&end60__" + goodsSortBzDrawerFabuEnd.getText().toString());
        }
        if (goodsSortBzDrawerShishiStart.getText().toString().equals("起始日期") && goodsSortBzDrawerShishiEnd.getText().toString().equals("截止日期")) {
            for (int i = 0; i < bzTimeList1.size(); i++) {
                if (bzTimeList1.get(i).isFlag()) {
                    if (bzTimeList1.get(i).getS().equals("近一个月")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(30);
                        sb.append("&start61__" + beforeDateTime);
                    } else if (bzTimeList1.get(i).getS().equals("近三个月")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(90);
                        sb.append("&start61__" + beforeDateTime);
                    } else if (bzTimeList1.get(i).getS().equals("近半年")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(180);
                        sb.append("&start61__" + beforeDateTime);
                    } else if (bzTimeList1.get(i).getS().equals("近一年")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(365);
                        sb.append("&start61__" + beforeDateTime);
                    }
                    String nowDateTime = DateUtils.getNowDateTime();
                    sb.append("&end61__" + nowDateTime);
                }
            }

        } else {
            sb.append("&start61__" + goodsSortBzDrawerFabuStart.getText().toString());
            sb.append("&end61__" + goodsSortBzDrawerFabuEnd.getText().toString());
        }
        String qicao = goodsSortBzDrawerQicaoEdit.getEditableText().toString().trim();
        Log.e("cjx", "起草人：" + qicao);
        if (!qicao.equals("")) {
            sb.append("&52__" + qicao);
        }
        String danwei = goodsSortBzDrawerDanweiEdit.getEditableText().toString().trim();
        if (!danwei.equals("")) {
            sb.append("&64__" + danwei);
        }
        String zhubian = goodsSortBzDrawerZhubianEdit.getEditableText().toString().trim();
        if (!zhubian.equals("")) {
            sb.append("&66__" + zhubian);
        }
        String zhuban = goodsSortBzDrawerZhubanEdit.getEditableText().toString().trim();
        if (!zhuban.equals("")) {
            sb.append("&65__" + zhuban);
        }
        Log.e("cjx", "拼接结果：" + sb.toString());
        return sb.toString();
    }

    @Override
    public void addBzSxCar(String skuStr,GoodsSortBzShowSxRvAdapter.GoodsSortBzShowRvViewHolder holder) {
        AddCar(skuStr);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        carView.destory();
    }

    //获取图书筛选数据
    private void initTsSureData() {
        String attrPro = getTsNowAttrPro();
        GoodsSortSearchAllTsSxApi searchAllSxApi = new GoodsSortSearchAllTsSxApi(this, searchAllTsSxListener, 1, 2, attrPro);
        searchAllSxApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllSxApi);
    }

    //获取图书筛选数据
    HttpOnNextListener<BaseResultEntity> searchAllTsSxListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                return;
            }
            setAllListClear();
            ArrayList<GoodsSortSearchTsSxBean> beans = (ArrayList<GoodsSortSearchTsSxBean>) subjects.getData();
            tsSxList.addAll(beans.get(1).getData());
            //主界面数据
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            tsShowTsSxRvAdapter = new GoodsSortTsSxShowRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(tsShowTsSxRvAdapter);
            tsShowTsSxRvAdapter.setGoodsTsSxListener(GoodsSortAllActivity.this);
            tsShowTsSxRvAdapter.setTsSxList(tsSxList);
            tsShowTsSxRvAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "ts timelist拿到数据" + e.getMessage());
        }
    };

    private String getTsNowAttrPro() {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < tsTsFenLeiDrawerList.size(); i++) {
            if (tsTsFenLeiDrawerList.get(i).isSelected()) {
                sb.append(tsTsFenLeiDrawerList.get(i).getCatId() + "__" + tsTsFenLeiDrawerList.get(i).getCatName());
            }
        }
        for (int i = 0; i < tsChuBanSheDrawerList.size(); i++) {
            if (tsChuBanSheDrawerList.get(i).isFlag()) {
                sb.append("&95__" + tsChuBanSheDrawerList.get(i).getS());
            }
        }
        String author = goodsSortTsDrawerAuthorEdit.getEditableText().toString();
        if (!author.equals("")) {
            sb.append("&91__" + author);
        }
        if (goodsSortTsDrawerChubantimeStart.getText().toString().equals("起始日期") && goodsSortTsDrawerChubantimeEnd.getText().toString().equals("截止日期")) {
            for (int i = 0; i < tsTimeDrawerList.size(); i++) {
                if (tsTimeDrawerList.get(i).isFlag()) {
                    if (tsTimeDrawerList.get(i).getS().equals("近一个月")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(30);
                        sb.append("&start93__" + beforeDateTime);
                    } else if (tsTimeDrawerList.get(i).getS().equals("近三个月")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(90);
                        sb.append("&start93__" + beforeDateTime);
                    } else if (tsTimeDrawerList.get(i).getS().equals("近半年")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(180);
                        sb.append("&start93__" + beforeDateTime);
                    } else if (tsTimeDrawerList.get(i).getS().equals("近一年")) {
                        String beforeDateTime = DateUtils.getBeforeDateTime(365);
                        sb.append("&start93__" + beforeDateTime);
                    }
                    String nowDateTime = DateUtils.getNowDateTime();
                    sb.append("&end93__" + nowDateTime);
                }
            }

        } else {
            sb.append("&start93__" + goodsSortTsDrawerChubantimeStart.getText().toString());
            sb.append("&end93__" + goodsSortTsDrawerChubantimeEnd.getText().toString());
        }
        Log.e("cjx", "图书拼接属性：" + sb.toString());
        return sb.toString();
    }

    @Override
    public void addTsSxCar(String skuStr) {
        AddCar(skuStr);
    }

    //获取文档筛选数据监听
    private void initWdSureData() {
        int nowCatId = getWdNowCatId();
        GoodsSortSearchAllWdSxApi searchAllSxApi = new GoodsSortSearchAllWdSxApi(this, searchAllSxListener, 1, nowCatId, keyword);
        searchAllSxApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllSxApi);
    }

    HttpOnNextListener<BaseResultEntity> searchAllSxListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                Log.e("cjx", "文档数据：" + subjects.getMsg());
                return;
            }
            setAllListClear();
            ArrayList<GoodsSortSearchAllWdBean> wdBeans = (ArrayList<GoodsSortSearchAllWdBean>) subjects.getData();
            wdSxBeanList.addAll(wdBeans.get(1).getData());
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            wdShowRvSxAdapter = new GoodsSortWdShowRvSxAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(wdShowRvSxAdapter);
            wdShowRvSxAdapter.setGoodsWdSxListener(GoodsSortAllActivity.this);
            wdShowRvSxAdapter.setBeanList(wdSxBeanList);
            wdShowRvSxAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "wd数据" + e.getMessage());
        }
    };

    private int getWdNowCatId() {
        int nowCatId = 0;
        for (int i = 0; i < wdDrwerList.size(); i++) {
            if (wdDrwerList.get(i).isSelected()) {
                nowCatId = wdDrwerList.get(i).getCatId();
            }
        }
        return nowCatId;
    }

    @Override
    public void addWdSxCar(String skuStr) {
        AddCar(skuStr);
    }

    private void initGjSureData() {
        Map<String, String> gjNowShuXing = getGjNowShuXing();
        String s = gjNowShuXing.get("nowTypeId");
        int nowTypeId = Integer.parseInt(s);
        String attrPro = gjNowShuXing.get("attrPro");
        Log.e("cjx", "Gj__nowTypeId:" + nowTypeId);
        Log.e("cjx", "Gj__nowattrPro:" + attrPro);
        GoodsSortSearchAllGjSxApi searchAllApi = new GoodsSortSearchAllGjSxApi(this, searchAllGjSxListener, 2, nowTypeId, attrPro);
        searchAllApi.setCache(false);
        HttpManager.getInstance().doHttpDeal(searchAllApi);
    }

    HttpOnNextListener<BaseResultEntity> searchAllGjSxListener = new HttpOnNextListener<BaseResultEntity>() {
        @Override
        public void onNext(BaseResultEntity subjects) {
            if (!subjects.getCode().equals("200")) {
                ToastTools.showToast(GoodsSortAllActivity.this, subjects.getMsg());
                return;
            }
            ArrayList<GoodsSortSearchAllGjBean> gjBeans = (ArrayList<GoodsSortSearchAllGjBean>) subjects.getData();
            gjSxBeanList.addAll(gjBeans.get(1).getData());
            goodsSortAllRv.setLayoutManager(new LinearLayoutManager(GoodsSortAllActivity.this));
            showSxRvAdapter = new GoodsSortGjShowSxRvAdapter(GoodsSortAllActivity.this);
            goodsSortAllRv.setAdapter(showSxRvAdapter);
            showSxRvAdapter.setGoodsGjSxListener(GoodsSortAllActivity.this);
            showSxRvAdapter.setGjSxBeanList(gjSxBeanList);
            showSxRvAdapter.notifyDataSetChanged();
        }

        @Override
        public void onCacheNext(String cache) {
        }

        @Override
        public void onError(final Throwable e) {
            Log.e("cjx", "软件工具数据" + e.getMessage());
        }
    };

    private Map<String, String> getGjNowShuXing() {
        Map<String, String> map = new HashMap<>();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < subCategoryBeanList.size(); i++) {
            if (subCategoryBeanList.get(i).isSelected()) {
                map.put("nowTypeId", subCategoryBeanList.get(i).getCatId() + "");
            }
        }
        for (int i = 0; i < usageModeList.size(); i++) {
            if (usageModeList.get(i).isSelected()) {
                sb.append("&29__" + usageModeList.get(i).getAttrValue());
            }
        }
        for (int i = 0; i < versionInformationList.size(); i++) {
            if (versionInformationList.get(i).isSelected()) {
                sb.append("&30__" + versionInformationList.get(i).getAttrValue());
            }
        }
        for (int i = 0; i < platformCarrierList.size(); i++) {
            if (platformCarrierList.get(i).isSelected()) {
                sb.append("&32__" + platformCarrierList.get(i).getAttrValue());
            }
        }
        for (int i = 0; i < priceNegotiableList.size(); i++) {
            if (priceNegotiableList.get(i).isSelected()) {
                sb.append("&181__" + priceNegotiableList.get(i).getAttrValue());
            }
        }
        for (int i = 0; i < useTimeList.size(); i++) {
            if (useTimeList.get(i).isSelected()) {
                if (useTimeList.get(i).getAttrValue().equals("一个月")) {
                    sb.append("&31__一个月");
                } else if (useTimeList.get(i).getAttrValue().equals("三个月")) {
                    sb.append("&31__三个月");
                } else if (useTimeList.get(i).getAttrValue().equals("永久")) {
                    sb.append("&31__永久");
                } else if (useTimeList.get(i).getAttrValue().equals("一年")) {
                    sb.append("&31__一年");
                } else if (useTimeList.get(i).getAttrValue().equals("一次")) {
                    sb.append("&31__一次");
                }
            }
        }
        map.put("attrPro", sb.toString());
        return map;
    }

    @Override
    public void addGjSxCar(String skuStr) {
        AddCar(skuStr);
    }
}
